//
//  ViewController.m
//  C语言
//
//  Created by ws on 2017/7/12.
//  Copyright © 2017年 王松. All rights reserved.
//

#import "ViewController.h"

@interface ViewController ()
@property(nonatomic,strong)NSMutableArray*arr;
@property(nonatomic,assign)int a;
@property(nonatomic,strong) UILabel *alabel;

@end

@implementation ViewController

-(void)test:(NSArray *)array{
    NSLog(@"个数 = %ld",array.count);
}
- (void)viewDidLoad {
    [super viewDidLoad];
    
//    NSArray *wsArr = @[@"1",@"0",@"2",@"23"];
//    NSLog(@"%p",wsArr);//0x60000004a320
//    NSLog(@"%p",&wsArr);//0x7fff54cdba60
//    NSLog(@"%p",wsArr[0]);//0x10b5d9098
//
//    printf("%p\n",wsArr);
//    printf("%p\n",&wsArr);
//    printf("%p\n",wsArr[0]);
//
//    char chars[] = {'a','b','c'};
//    //数组名称本身就是一个地址
//    printf("数组的地址 = %p\n",chars);//0x7fff5fbff70d
//    printf("数组的地址 = %p\n",&chars[0]); //0x7fff5fbff70d
    
    
    int a = 10;
    NSLog(@"前 = %d",a);
    [self testInt:a];
    NSLog(@"后 = %d",a);
//
//    
    NSString *str = @"00000";
    NSLog(@"str前 = %@",str);
    [self testStr:str];
    NSLog(@"str后 = %@",str);
    
    
    self.alabel = [[UILabel alloc]initWithFrame:CGRectMake(0, 100, [UIScreen mainScreen].bounds.size.width, 100)];
   self.alabel.text = @"这是谁的iPhone X放我这了 赶紧拿走";
    [self.alabel setTextColor:[UIColor cyanColor]];
    
//    self.alabel.textAlignment = NSTextAlignmentCenter;
    [self.alabel setTextAlignment:NSTextAlignmentCenter];
    [self.view addSubview:self.alabel];
    [self testLabelText:self.alabel.text];
    NSLog(@"%@",self.alabel.text);
}
//基本数据类型是值类型传递
-(void)testInt:(int)num{
    num = 30;
    NSLog(@"num = %d",num);
}
//字符串是值类型传递
-(void)testStr:(NSString *)str{
    str = @"123456";
    NSLog(@"str = %@",str);
}

-(void)testLabelText:(NSString *)str{
    str = @"123456";
    NSLog(@"labelText = %@",str);
}
@end
